# 预设正确的账号和密码
correct_username = "admin"
correct_password = "123456"
# 初始化错误次数
error_count = 0

while error_count < 3:
    username = input("请输入账号：")
    password = input("请输入密码：")
    
    if username == correct_username and password == correct_password:
        print("登录成功")
        break
    else:
        error_count += 1
        remaining_chances = 3 - error_count
        print("用户名或密码错误")
        if remaining_chances > 0:
            print(f"您还有{remaining_chances}次机会")
else:
    print("输入错误次数过多，请稍后再试")